import service from '@/utils/request'

export function getAllNotices() {
    return service({
      url: `/notices/nots/`,
      method: 'get'
    })
}

export function getNotices(pageNum: number, pageSize: number) {
  return service({
    url: `/notices/nots/${pageNum}/${pageSize}`,
    method: 'get'
  })
}

export function getNoticesById(id: string) {
    return service({
      url: `/notices/nots/${id}`,
      method: 'get'
    })
}

export function searchNotices(queryInfo) {
  return service({
    url: `/notices/nots/byKeyword/${queryInfo.pageNum}/${queryInfo.pageSize}?keyword=${queryInfo.query}`,
    method: 'get',
  })
}

export function addNotices(params) {
    return service({
      url: `/notices/nots/`,
      method: 'post',
      data: params
    })
}

export function editNotices(id: string, params) {
    return service({
      url: `/notices/nots/${id}`,
      method: 'put',
      data: params
    })
}

export function delNotices(id: string) {
  return service({
    url: `/notices/nots/${id}`,
    method: 'delete',
  })
}